package org.bemo.controller;

import java.util.Date;

import org.bemo.model.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.blade.ioc.annotation.Inject;
import com.blade.jdbc.ActiveRecord;
import com.blade.jdbc.core.Take;
import com.blade.mvc.annotation.Controller;
import com.blade.mvc.annotation.Route;
import com.blade.mvc.http.Request;

@Controller()
public class IndexController {
	public static final String CLASSPATH = IndexController.class.getClassLoader().getResource("").getPath();
	private static final Logger LOGGER = LoggerFactory.getLogger(IndexController.class);
	
	@Inject
	private ActiveRecord activeRecord;

	@Route("/")
	public String users(Request request) {
		Category category = new Category();
		category.setCid(1L);
		Category one = activeRecord.one(category);
		System.out.println(one.getCname());
		
		System.out.println(activeRecord.toString());
		request.attribute("footerPublic","系统报时："+new Date());
		return "html/index";
	}
}
